﻿using Utils;

namespace StockAnalyst2.Chart
{
	internal class Options : ICloneable<Options>, ICopyable<Options>
	{
		#region Properties

		public ChartSource DataSource { get; set; }

		public SeriesOptions LastValue { get; private set; }
		public SeriesOptions BidAskAverage { get; private set; }
		public SeriesOptions Bid { get; private set; }
		public SeriesOptions Ask { get; private set; }
		public SeriesOptions SMA1 { get; private set; }
		public SeriesOptions SMA2 { get; private set; }
		public SeriesOptions SMA3 { get; private set; }
		public SeriesOptions Stochastic { get; private set; }
		public SeriesOptions Gap { get; private set; }
		public SeriesOptions Trix { get; private set; }
		public SeriesOptions TrixChangeRatio { get; private set; }
		public SeriesOptions Volume { get; private set; }
		public SeriesOptions TotalVolume { get; private set; }
		public SeriesOptions AverageVolume { get; private set; }

		#endregion

		#region Public Methods

		public Options()
		{
			this.LastValue = new SeriesOptions();
			this.BidAskAverage = new SeriesOptions();
			this.Bid = new SeriesOptions();
			this.Ask = new SeriesOptions();
			this.SMA1 = new SeriesOptions();
			this.SMA2 = new SeriesOptions();
			this.SMA3 = new SeriesOptions();
			this.Stochastic = new SeriesOptions();
			this.Gap = new SeriesOptions();
			this.Trix = new SeriesOptions();
			this.TrixChangeRatio = new SeriesOptions();
			this.Volume = new SeriesOptions();
			this.TotalVolume = new SeriesOptions();
			this.AverageVolume = new SeriesOptions();
		}

		public Options Clone()
		{
			Options result = new Options();

			result.Copy(this);

			return result;
		}

		public void Copy(Options source)
		{
			this.DataSource = source.DataSource;

			this.LastValue.Copy(source.LastValue);
			this.BidAskAverage.Copy(source.BidAskAverage);
			this.Bid.Copy(source.Bid);
			this.Ask.Copy(source.Ask);
			this.SMA1.Copy(source.SMA1);
			this.SMA2.Copy(source.SMA2);
			this.SMA3.Copy(source.SMA3);
			this.Stochastic.Copy(source.Stochastic);
			this.Gap.Copy(source.Gap);
			this.Trix.Copy(source.Trix);
			this.TrixChangeRatio.Copy(source.TrixChangeRatio);
			this.Volume.Copy(source.Volume);
			this.TotalVolume.Copy(source.TotalVolume);
			this.AverageVolume.Copy(source.AverageVolume);
		}

		#endregion
	}
}
